jQuery(document).ready(function()
{
  _init_control()

});

function _init_control(){

jQuery('#_chart_fd').datetimebox({  
        showSeconds:false,
        mulitple: false,
        editable: false
    });
    jQuery('#_chart_td').datetimebox({  
        showSeconds:false,
        mulitple: false,
        editable: false
    });  
}

function _view_chart(type)
{
    var from_date = $('#_chart_fd').datetimebox('getValue');
    var to_date = $('#_chart_td').datetimebox('getValue');
    if(from_date!=""&&to_date!="")
    {
        from_date=(new Date(from_date)).getTime()
        to_date=(new Date(to_date)).getTime()
     }
     if(type!=null)
     {
         url="/index.php?module=mailsystemmodule&action=chart_json&ajax_action=1&timeby=hour";
         jQuery.getJSON(url, function(data) {
             d=data;
             
         })
     }
     $.plot($("#placeholder"), [d], {
            xaxis: {
                mode: "time",                
                min: from_date,
                max: to_date
            }
        });
}



